home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / tpega.zip / GPVIEWPO.P < prev    next >
Text File  |  1986-01-20  |  903b  |  37 lines

  1. {                                                                             }
  2. {       EGA Graphic Primitive for Turbo Pascal 3.01A, Version 01FEB86.        }
  3. {       (C) 1986 by Kent Cedola, 2015 Meadow Lake Ct., Norfolk, VA, 23518     }
  4. {                                                                             }
  5. {       Description: Set the current viewport.                                }
  6. {                                                                             }
  7.  
  8. procedure GPVIEWPORT(X1,Y1,X2,Y2: Integer);
  9. var
  10.   i: Integer;
  11. begin
  12.   if X1 > X2 then
  13.     begin
  14.       i  := X1;
  15.       X1 := X2;
  16.       X2 := i;
  17.     end;
  18.  
  19.   if Y1 > Y2 then
  20.     begin
  21.       i  := Y1;
  22.       Y1 := Y2;
  23.       Y2 := i;
  24.     end;
  25.  
  26.   GDVW_X1 := X1;
  27.   GDVW_Y1 := Y1;
  28.   GDVW_X2 := X2;
  29.   GDVW_Y2 := Y2;
  30.  
  31.   GDVW_X3 := X2 - X1 + 1;
  32.   GDVW_Y3 := Y2 - Y1 + 1;
  33.  
  34.   GDW_FLG := True;
  35.  
  36. end;
  37.